/*
 * @Description:
 * @Author: HYH
 * @LastEditors: HYH
 * @LastEditTime: 2022-08-26 16:40:16
 */
import appConfig, { IAppConfig, IModItem } from './appConfig'
const app = {
  /**获取系统配置信息 */
  getConfig<T>(key: keyof IAppConfig): T {
    return appConfig[key] as unknown as T
  },

  /**检测是否启用了某个模块 */
  checkModIsEnable(modName: string) {
    const enabledMods: IModItem[] = app.getConfig<IModItem[]>('moduleNames')
    return enabledMods.find(item => item.name === modName && item.enable)
  },

  getUserInfo() {}
}
export type IApp = typeof app
export default app
